import 'package:flutter/material.dart';
import 'package:wanchong/widget/app_bar.dart';
import 'package:wanchong/path.dart';

class PetDevice extends StatefulWidget {
  final int id;
  PetDevice({Key key,this.id}):super(key:key);
  @override
  _UserInfoState createState() => _UserInfoState();
}

class _UserInfoState extends State<PetDevice> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: MyAppBar(
          child: Align(
        //alignment: Alignment.center,
        child: Container(
          padding: EdgeInsets.only(left: 10.0, right: 10.0),
          child: Stack(
            children: <Widget>[
              GestureDetector(
                onTap: () {
                  Navigator.pop(context);
                },
                child: new Align(
                  alignment: FractionalOffset.centerLeft,
                  child: Container(
                    padding: EdgeInsets.only(right: 15.0),
                    color: Colors.transparent,
                    height: double.infinity,
                    child: Image.asset("assets/login/top_return_icon.png"),
                  ),
                ),
              ),
              new Align(
                alignment: FractionalOffset.center,
                child: new Text(
                  '设备信息',
                  style: new TextStyle(
                    color: Color(0xFF3C4450),
                    fontSize: 15.0,
                    fontWeight: FontWeight.w700,
                  ),
                ),
              ),
            ],
          ),
        ),
      )),
      body: Container(
        height: double.infinity,
        child: Column(
          children: <Widget>[
            Expanded(
                child: Container(
              child: ListView(
                physics: BouncingScrollPhysics(),
                children: <Widget>[
                  GestureDetector(
                    child: Container(
                      height: 60,
                      color: Colors.white,
                      padding: EdgeInsets.only(left: 15.0, right: 15.0),
                      margin: EdgeInsets.only(top: 15.0),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: <Widget>[
                          Text(
                            '设备型号',
                            style: new TextStyle(
                                color: Color(0xFF3C4450), fontSize: 14.0),
                          ),
                          Text(
                            'ZHMC-BO-AIRPRO',
                            style: new TextStyle(
                                color: Color(0xFFB4BEC6), fontSize: 14.0),
                          ),
                        ],
                      ),
                    ),
                  ),
                  Container(
                    height: 1,
                    color: Color(0x5eDBDBDB),
                    margin: EdgeInsets.only(left: 15.0),
                  ),
                  GestureDetector(
                    child: Container(
                      height: 60,
                      color: Colors.white,
                      padding: EdgeInsets.only(left: 15.0, right: 15.0),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: <Widget>[
                          Text(
                            '设备编码',
                            style: new TextStyle(
                                color: Color(0xFF3C4450), fontSize: 14.0),
                          ),
                          Text(
                            'JSAF902948DF4',
                            style: new TextStyle(
                                color: Color(0xFFB4BEC6), fontSize: 14.0),
                          ),
                        ],
                      ),
                    ),
                  ),
                  Container(
                    height: 1,
                    color: Color(0x5eDBDBDB),
                    margin: EdgeInsets.only(left: 15.0),
                  ),
                  GestureDetector(
                    child: Container(
                      height: 60,
                      color: Colors.white,
                      padding: EdgeInsets.only(left: 15.0, right: 15.0),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: <Widget>[
                          Text(
                            '系统版本',
                            style: new TextStyle(
                                color: Color(0xFF3C4450), fontSize: 14.0),
                          ),
                          Text(
                            'Z02.01.24.1',
                            style: new TextStyle(
                                color: Color(0xFFB4BEC6), fontSize: 14.0),
                          ),
                        ],
                      ),
                    ),
                  ),
                  Container(
                    height: 1,
                    color: Color(0x5eDBDBDB),
                    margin: EdgeInsets.only(left: 15.0),
                  ),
                  GestureDetector(
                    child: Container(
                      height: 60,
                      color: Colors.white,
                      padding: EdgeInsets.only(left: 15.0, right: 15.0),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: <Widget>[
                          Text(
                            '4G网络号',
                            style: new TextStyle(
                                color: Color(0xFF3C4450), fontSize: 14.0),
                          ),
                          Text(
                            '158 2901 2832',
                            style: new TextStyle(
                                color: Color(0xFFB4BEC6), fontSize: 14.0),
                          ),
                        ],
                      ),
                    ),
                  ),
                  GestureDetector(
                    child: Container(
                      height: 60,
                      color: Colors.white,
                      padding: EdgeInsets.only(left: 15.0, right: 15.0),
                      margin: EdgeInsets.only(top: 15.0),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: <Widget>[
                          Text(
                            '当前电量',
                            style: new TextStyle(
                                color: Color(0xFF3C4450), fontSize: 14.0),
                          ),
                          Text(
                            '80%',
                            style: new TextStyle(
                                color: Color(0xFF4DC975), fontSize: 14.0),
                          ),
                        ],
                      ),
                    ),
                  ),
                  Container(
                    height: 1,
                    color: Color(0x5eDBDBDB),
                    margin: EdgeInsets.only(left: 15.0),
                  ),
                  GestureDetector(
                    child: Container(
                      height: 60,
                      color: Colors.white,
                      padding: EdgeInsets.only(left: 15.0, right: 15.0),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: <Widget>[
                          Text(
                            '状态',
                            style: new TextStyle(
                                color: Color(0xFF3C4450), fontSize: 14.0),
                          ),
                          Text(
                            '在线，已连接',
                            style: new TextStyle(
                                color: Color(0xFFB4BEC6), fontSize: 14.0),
                          ),
                        ],
                      ),
                    ),
                  ),
                  Container(
                    height: 1,
                    color: Color(0x5eDBDBDB),
                    margin: EdgeInsets.only(left: 15.0),
                  ),
                  GestureDetector(
                      child: Column(
                    children: <Widget>[
                      Container(
                        height: 60.0,
                        color: Color(0xFFFFFFFF),
                        padding: EdgeInsets.only(left: 15.0, right: 10.0),
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: <Widget>[
                            Container(
                              child: Text(
                                "关联宠物",
                                style: new TextStyle(
                                    color: Color(0xFF3C4450),
                                    fontSize: 14.0,
                                    decoration: TextDecoration.none),
                              ),
                            ),
                            Row(
                              children: <Widget>[
                                Text(
                                  "小Q",
                                  style: new TextStyle(
                                      color: Color(0xFFB4BEC6), fontSize: 14.0),
                                ),
                                Icon(
                                  Icons.chevron_right,
                                  color: Color(0xFFB4BEC6),
                                )
                              ],
                            )
                          ],
                        ),
                      ),
                      Container(
                        height: 1,
                        color: Color(0x5eDBDBDB),
                        margin: EdgeInsets.only(left: 15.0),
                      )
                    ],
                  )),
                  GestureDetector(
                      child: Column(
                    children: <Widget>[
                      Container(
                        height: 60.0,
                        color: Color(0xFFFFFFFF),
                        padding: EdgeInsets.only(left: 15.0, right: 10.0),
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: <Widget>[
                            Container(
                              child: Text(
                                "记录数据",
                                style: new TextStyle(
                                    color: Color(0xFF3C4450),
                                    fontSize: 14.0,
                                    decoration: TextDecoration.none),
                              ),
                            ),
                            Row(
                              children: <Widget>[
                                Text(
                                  "",
                                  style: new TextStyle(
                                      color: Color(0xFFB4BEC6), fontSize: 14.0),
                                ),
                                Icon(
                                  Icons.chevron_right,
                                  color: Color(0xFFB4BEC6),
                                )
                              ],
                            )
                          ],
                        ),
                      ),
                    ],
                  )),
                ],
              ),
            )),
            GestureDetector(
              child: Stack(
                children: <Widget>[
                  Positioned(
                    child: Container(
                      padding: EdgeInsets.only(bottom: 15.0),
                      height: 65.0,
                      width: double.infinity,
                      alignment: Alignment.center,
                      color: Colors.white,
                      child: Text(
                        "移除设备",
                        style:
                            TextStyle(fontSize: 14.0, color: Color(0xFFFF5C64)),
                      ),
                    ),
                  )
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
